import psutil
def getMemorystate():
    phymem = psutil.virtual_memory()
    return [phymem.percent,int(phymem.used / 1024 / 1024),int(phymem.total / 1024 / 1024)]

if __name__ == "__main__":
        print("%-15s:%s%% %6s/%s" % ("Memory",
                                      getMemorystate()[0],
                                      str(getMemorystate()[1]) + "M",
                                      str(getMemorystate()[2]) + "M"
                                      ))
